$(function(){
	$(".djtou").on("touchend",function(){
		$(".bg").css("display","block");
		$(".caozuo").css("display","block");
	});
	///////////////昵称
	var nicheng = localStorage.getItem("name");
	$(".nicheng").html(nicheng);
	
	
	/////////////摄像头
	$('input').on('change',function(e){
	var tar = this,
		files = tar.files,
		fNum = files.length,
		URL = window.URL || window.webkitURL;
	if(!files[0])return;
	
	for(var i=0;i<fNum;i++){
		if(files[i].type.search(/image/)>=0){
			var blob = URL.createObjectURL(files[i]);

//			var newImg = new Image();
//			newImg.onload = function(){
//				document.body.appendChild(newImg);
//			};
			$(".djtou").get(0).src = blob;
			$(".bg").css("display","none");
			$(".caozuo").css("display","none");
		}
	}
});

//////////////////////////////////////////////购物车

var num=0;
		$.ajax({
			  type: "get",
			   url: "http://datainfo.duapp.com/shopdata/getCar.php",
			   data: {userID:nicheng},
			   dataType:"jsonp",
			   success:function(data){
			   	$.each(data, function(index){
			     	num+=parseInt(data[index].number);
			     	
			   	})
//			   	console.log(liang,num);
			   	if(num){
					$(".car_num1").css("display","block").html(num);
				}else{
					$(".car_num1").css("display","none")
				}
			   }
			});
		




////////////////////////////////
	$(".fenlei").on("touchend",function(){
		window.open("shoplist.html","_self");
	})
	/////////////////////////////////////
	$(".gouwuche").on("touchend",function(){
		window.open("gouwuche.html","_self")
	})
	/////////////////////////////////////
	$(".wodexiu").on("touchend",function(){
		window.open("wdxiu.html","_self")
	})
	//////////////////////////////
	$(".genduo").on("touchend",function(){
		window.open("chouj.html","_self")
	})






})
